<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\search\WxUserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '用户';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wx-user-index">
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            'id',
//            'wx_aid',
            [
                'label'=>'积分余额',
//                'options' => ['width' => '60px'],
                'filter'=>false,
                'format'=>'raw',
                'value'=>function($model){
                    return $model->pointAccount?$model->pointAccount->point:'';
                }
            ],
            'subscribe',
            'nickname',
            [
                'attribute'=>'headimgurl',
                'options' => ['width' => '60px'],
                'filter'=>false,
                'format'=>'raw',
                'value'=>function($model){
                    return $model->showAvatar();
                }
            ],
            [
                'attribute'=>'ctime',
//                'options' => ['width' => '60px'],
                'filter'=>false,
                'format'=>'raw',
                'value'=>function($model){
                    return date('Y-m-d H:i:s',$model->ctime);
                }
            ],
            'sex',
            'province',
            'city',
            //'headimgurl',
            //'ctime:datetime',
            //'json_data:ntext',
//            'point_charge_nums',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>


</div>
